/* 收藏页面特定样式 */

/* 主内容区域 */
.favorites-main {
    gap: 0;
    padding-top: 0;
    background-color: var(--secondary-bg);
}

/* 页面标题区域 */
.favorites-header {
    background: linear-gradient(135deg, #2c3e50, #1a1a1a);
    padding: 40px;
    border-radius: 0 0 20px 20px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.favorites-header:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect width="100" height="100" fill="none" stroke="%23ffffff" stroke-opacity="0.05" stroke-width="1"/></svg>');
    opacity: 0.2;
    z-index: 0;
}

.header-content {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header-text h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.header-text p {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 500px;
}

.header-stats {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.stat-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: transform 0.2s, background 0.2s;
}

.stat-pill:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.stat-pill i {
    color: var(--highlight-color);
    font-size: 1rem;
}

/* 过滤栏 */
.filters-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 0 40px;
    flex-wrap: wrap;
    gap: 20px;
}

.filters-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    background: var(--button-bg);
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: var(--button-hover);
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--highlight-color);
    color: white;
}

.filter-btn i {
    font-size: 0.9rem;
}

.view-sort-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.sort-dropdown {
    position: relative;
}

.sort-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    background: var(--button-bg);
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.sort-btn:hover {
    background: var(--button-hover);
    color: var(--text-primary);
}

.sort-btn i:last-child {
    font-size: 0.8rem;
    margin-left: 2px;
}

.sort-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 5px;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: 180px;
    z-index: 100;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s;
}

.sort-dropdown:hover .sort-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sort-dropdown-menu a {
    display: block;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.sort-dropdown-menu a:hover {
    background: var(--button-hover);
    color: var(--text-primary);
}

.view-toggle {
    display: flex;
    background: var(--button-bg);
    border-radius: 8px;
    overflow: hidden;
}

.view-btn {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.view-btn:hover {
    color: var(--text-primary);
}

.view-btn.active {
    background: var(--button-active);
    color: var(--text-primary);
}

/* 收藏项目容器 */
.collection-container {
    padding: 0 40px;
    margin-bottom: 40px;
}

.collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 25px;
}

.collection-grid.list-view {
    grid-template-columns: 1fr;
}

/* 收藏项目卡片 */
.collection-item {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}

.collection-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.item-cover {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 140%;
    overflow: hidden;
}

.item-cover img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.collection-item:hover .item-cover img {
    transform: scale(1.05);
}

.item-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.audiobook-badge {
    background: linear-gradient(135deg, #ff416c, #ff4b2b);
}

.pdf-badge {
    background: linear-gradient(135deg, #2193b0, #6dd5ed);
}

.item-actions {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s;
}

.collection-item:hover .item-actions {
    opacity: 1;
    transform: translateX(0);
}

.action-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: all 0.2s;
}

.play-btn {
    background: var(--highlight-color);
}

.play-btn:hover {
    background: #ff2c38;
    transform: scale(1.1);
}

.read-btn {
    background: #2193b0;
}

.read-btn:hover {
    background: #1c7a8c;
    transform: scale(1.1);
}

.remove-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    color: #ff4b4b;
    transform: scale(1.1);
}

.progress-overlay {
    position: absolute;
    bottom: 15px;
    right: 15px;
}

.progress-ring {
    width: 44px;
    height: 44px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-ring svg {
    transform: rotate(-90deg);
}

.progress-ring-circle-bg {
    fill: transparent;
    stroke: rgba(0, 0, 0, 0.3);
    stroke-width: 4;
}

.progress-ring-circle {
    fill: transparent;
    stroke: white;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 126;
    transition: stroke-dashoffset 0.3s;
}

.progress-text {
    position: absolute;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
}

.item-info {
    padding: 20px;
}

.item-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.item-author {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-bottom: 10px;
}

.item-duration i,
.item-pages i {
    margin-right: 4px;
}

.audiobook-type {
    color: #ff416c;
}

.pdf-type {
    color: #2193b0;
}

.item-last-activity {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.item-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.item-actions button {
    z-index: 2;
    position: relative;
}

/* 列表视图样式覆盖 */
.collection-grid.list-view .collection-item {
    display: flex;
    height: 140px;
}

.collection-grid.list-view .item-cover {
    width: 100px;
    height: 100%;
    padding-bottom: 0;
    flex-shrink: 0;
}

.collection-grid.list-view .item-info {
    flex: 1;
}

/* 活动部分 */
.activity-section {
    padding: 30px 40px;
    margin-top: 20px;
    background: var(--card-bg);
    border-radius: 20px;
    margin: 0 40px 40px;
}

.section-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    color: var(--highlight-color);
}

/* 图表容器 */
.activity-chart-container {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.chart-header h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}

.chart-legend {
    display: flex;
    gap: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.legend-color {
    display: block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.audiobook-color {
    background: linear-gradient(135deg, #ff416c, #ff4b2b);
}

.pdf-color {
    background: linear-gradient(135deg, #2193b0, #6dd5ed);
}

/* 活动图表 */
.activity-chart {
    display: flex;
    height: 200px;
    gap: 2%;
    align-items: flex-end;
    margin-top: 30px;
}

.chart-bar-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* 静态图表特定样式 */
.chart-bar-container.static-chart {
    animation: fadeIn 0.5s ease-in-out;
    animation-fill-mode: both;
}

.chart-bar-container.static-chart:nth-child(1) { animation-delay: 0.1s; }
.chart-bar-container.static-chart:nth-child(2) { animation-delay: 0.2s; }
.chart-bar-container.static-chart:nth-child(3) { animation-delay: 0.3s; }
.chart-bar-container.static-chart:nth-child(4) { animation-delay: 0.4s; }
.chart-bar-container.static-chart:nth-child(5) { animation-delay: 0.5s; }
.chart-bar-container.static-chart:nth-child(6) { animation-delay: 0.6s; }
.chart-bar-container.static-chart:nth-child(7) { animation-delay: 0.7s; }

.chart-day {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.chart-bar {
    width: 100%;
    height: 140px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column-reverse;
}

.bar-segment {
    width: 100%;
    transition: height 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.audiobook-segment {
    background: linear-gradient(0deg, rgba(255,65,108,0.8), rgba(255,75,43,0.8));
}

.pdf-segment {
    background: linear-gradient(0deg, rgba(33,147,176,0.8), rgba(109,213,237,0.8));
}

.chart-value {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.chart-bar-container.today .chart-day,
.chart-bar-container.today .chart-value {
    color: var(--text-primary);
    font-weight: 600;
}

.chart-bar-container:hover .bar-segment.audiobook-segment {
    background: linear-gradient(0deg, rgba(255,65,108,1), rgba(255,75,43,1));
}

.chart-bar-container:hover .bar-segment.pdf-segment {
    background: linear-gradient(0deg, rgba(33,147,176,1), rgba(109,213,237,1));
}

/* 活动时间线 */
.activity-timeline {
    margin-top: 40px;
}

.activity-timeline h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.timeline {
    position: relative;
}

.timeline:before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 17px;
    width: 2px;
    background: rgba(255, 255, 255, 0.1);
}

.timeline-item {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    position: relative;
}

/* 静态时间线特定样式 */
.timeline-item.static-timeline {
    animation: slideInLeft 0.5s ease-in-out;
    animation-fill-mode: both;
}

.timeline-item.static-timeline:nth-child(1) { animation-delay: 0.1s; }
.timeline-item.static-timeline:nth-child(2) { animation-delay: 0.3s; }
.timeline-item.static-timeline:nth-child(3) { animation-delay: 0.5s; }
.timeline-item.static-timeline:nth-child(4) { animation-delay: 0.7s; }
.timeline-item.static-timeline:nth-child(5) { animation-delay: 0.9s; }

.timeline-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--button-bg);
    color: white;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.audiobook-icon {
    background: linear-gradient(135deg, #ff416c, #ff4b2b);
}

.pdf-icon {
    background: linear-gradient(135deg, #2193b0, #6dd5ed);
}

.heart-icon {
    background: linear-gradient(135deg, #a445b2, #ff0080);
}

.timeline-content {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 15px;
}

.timeline-time {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-bottom: 5px;
}

.timeline-content h4 {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.timeline-progress {
    margin-top: 10px;
}

.timeline-progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 5px;
}

.timeline-progress-fill {
    height: 100%;
    background: var(--highlight-color);
}

.timeline-progress span {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 3rem;
    color: var(--text-tertiary);
    margin-bottom: 20px;
}

.empty-state h2 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 30px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.primary-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: var(--highlight-color);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(252, 60, 68, 0.3);
}

/* 静态数据的入场动画 */
@keyframes fadeIn {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 响应式设计 */
@media (max-width: 900px) {
    .favorites-header,
    .filters-bar,
    .collection-container,
    .activity-section {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filters-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .collection-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .activity-chart {
        height: 150px;
    }
}

@media (max-width: 600px) {
    .collection-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
    
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .timeline-item {
        gap: 10px;
    }
    
    .timeline-icon {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
    }
    
    .timeline:before {
        left: 14px;
    }
}

@media (max-width: 480px) {
    .stat-pill {
        width: 100%;
    }
    
    .collection-grid {
        grid-template-columns: 1fr;
    }
    
    .activity-chart {
        overflow-x: auto;
        margin: 0 -20px;
        padding: 0 20px;
    }
    
    .chart-bar-container {
        min-width: 60px;
    }
}

/* 开发者配置面板样式 */
.dev-panel {
    margin-top: 30px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    overflow: hidden;
    font-size: 0.85rem;
    margin-left: 15px;
    margin-right: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dev-panel-header {
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
}

.dev-panel-header h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
    color: var(--highlight-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.dev-panel-content {
    padding: 15px;
}

.dev-option {
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dev-option:last-child {
    margin-bottom: 0;
}

.dev-option label {
    color: var(--text-secondary);
}

/* 开关样式 */
.switch-container {
    position: relative;
    display: inline-block;
}

.switch-input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.switch-label {
    display: block;
    width: 75px;
    height: 30px;
    background: var(--button-bg);
    border-radius: 15px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
    overflow: hidden;
}

.switch-input:checked + .switch-label {
    background: var(--highlight-color);
}

.switch-on,
.switch-off {
    position: absolute;
    font-size: 0.7rem;
    font-weight: 600;
    width: 45px;
    text-align: center;
    transition: all 0.3s;
    z-index: 1;
    line-height: 30px;
    color: white;
}

.switch-on {
    left: 0;
    opacity: 0;
}

.switch-off {
    right: 0;
    opacity: 1;
}

.switch-input:checked + .switch-label .switch-on {
    opacity: 1;
}

.switch-input:checked + .switch-label .switch-off {
    opacity: 0;
}

.switch-handle {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    transition: transform 0.3s;
    z-index: 2;
}

.switch-input:checked + .switch-label .switch-handle {
    transform: translateX(45px);
}

@media (max-width: 768px) {
    .dev-panel {
        margin-top: 20px;
        margin-left: 10px;
        margin-right: 10px;
    }
} 